from launch import LaunchDescription
from launch_ros.actions import Node
from launch.actions import DeclareLaunchArgument
from launch.launch_description_sources import PythonLaunchDescriptionSource

from ament_index_python.packages import get_package_share_directory
from launch.conditions import IfCondition
import os
from launch.actions import IncludeLaunchDescription
from launch.substitutions import LaunchConfiguration


def generate_launch_description():
    go2_lidar_pkg = get_package_share_directory("go2_perception")
    go2_driver_pkg = get_package_share_directory("go2_driver_py")

    
    return LaunchDescription([


        IncludeLaunchDescription(
            launch_description_source=PythonLaunchDescriptionSource(
                launch_file_path=os.path.join(go2_lidar_pkg,"launch","go2_pointcloud_process.launch.py")
            ),
        ),
            


        Node(
            package="laser_follower",
            executable="laser_follower_node"
        ),

        Node(
            package="go2_twist_bridge_py",
            executable="twist_bridge"
        ),



        Node(
            package="go2_driver_py",
            executable="driver",
            parameters=[
                os.path.join(go2_driver_pkg, "params", "go2_driver.yaml")
            ]
        ),
    ])